package domain;

import dto.*;
import java.net.ConnectException;

/**
 *
 * @author Joachim
 */
public class WelcomeController {
    
    private Client client;
    
    public WelcomeController(Client client) {
        this.client = client;
    }
    
    public String getEmail()
    {
        System.out.println(client.getEmail());
        return client.getEmail();
    }

    public boolean logIn(LoginDTO dto) throws IllegalArgumentException, ConnectException {
        return client.logIn(dto.getEmail(), dto.getPassword());
    }
    
    public boolean register(RegisterDTO dto) throws IllegalArgumentException, ConnectException {
        return client.register(dto.getEmail(), dto.getPassword(), dto.getRepeatPassword());
    }
    
    public boolean resetPassword(ResetPasswordDTO dto)throws IllegalArgumentException, ConnectException {
        return client.resetPassword(dto.getEmail());
    }
    
}
